package com.shark.mq;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.beans.factory.annotation.Value;

/**
 * @auther shark
 * @create 2024-08-04 17:07
 */
@Component
public class MyMessageListenerV2
{
    @Value("${server.port}")
    private String serverPort;

    //1.2 工作队列模式代码
    @RabbitListener(queues = {"atguigu.queue.work"})
    public void workMessage(String messageContent) {
        System.out.println("workMessageContent = " + messageContent+"\t"+serverPort);
    }

    /*@RabbitListener(queues = {"atguigu.queue.fanout02"})
    public void fanoutMessage(String messageContent) {
        System.out.println("Consumer02 Content:" + messageContent);
    }*/
}
